//
//  HGCollectionViewCell.m
//  个人项目(豆瓣元旦作业)
//
//  Created by dllo on 16/1/7.
//  Copyright © 2016年 guoguo. All rights reserved.
//

#import "HGCollectionViewCell.h"

@implementation HGCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self initcollectionCell];
    }
    return self;
}


- (void)initcollectionCell{
    self.image = [[UIImageView alloc] init];
    [self.contentView addSubview:_image];
    
    self.label = [[UILabel alloc] init];
    [self.contentView addSubview:_label];
    
    
}


- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    
    _image.frame = CGRectMake(0, 0, layoutAttributes.frame.size.width, layoutAttributes.frame.size.height - 30);
    
    
    _label.frame = CGRectMake(0, layoutAttributes.frame.size.height - 30, layoutAttributes.frame.size.width, 30);
    _label.backgroundColor = [UIColor redColor];
    _label.alpha = 0.5;
    _label.textAlignment = NSTextAlignmentCenter;
    _label.textColor = [UIColor whiteColor];
    
}


@end
